package edu.neu.wsy.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;


/**
 * <h1>通用相应对象定义</h1>
 * {
 *     "code": 0,
 *     "message": ""
 *     "data": {}
 * }
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class CommonResponse<T> implements Serializable {

    /* 错误码 */
    private Integer code;

    /* 错误消息 */
    private String message;

    /* 泛型数据 */
    private T data;

    /**
     * <h2>构造方法</h2>
     * @param code 错误码
     * @param message 错误消息
     */
    public CommonResponse(Integer code, String message){
        this.code = code;
        this.message = message;
    }
}

